import { request } from "@/utils/service"
import type * as bill from "./types/bill"
import type * as bill_log from "./types/bill_log"
import type * as bill_upload from "./types/bill_upload"
import type * as company_bill from "./types/company_bill"

/** 查 */
export function getBillListApi(params: bill.GetTableRequestData) {
  return request<bill.GetTableResponseData>({
    url: "/Bill/list",
    method: "get",
    params
  })
}

export function getDetailsApi(params: bill.getDetailsRequestData) {
  return request<any>({
    url: "/Bill/getDetails",
    method: "get",
    params
  })
}

export function getBillLogListApi(params: bill_log.GetTableRequestData) {
  return request<bill_log.GetBillResponseData>({
    url: "/BillLog/list",
    method: "get",
    params
  })
}

export function getIndexApi(params: bill.getIndexRequestData) {
  return request({
    url: "/Bill/getIndex",
    method: "get",
    params
  })
}

export function getCountApi(params: bill.getCountRequestData) {
  return request({
    url: "/Bill/getCount",
    method: "get",
    params
  })
}

export function doBatchSellUploadApi(data: any) {
  return request({
    url: "/Bill/batchSellUpload",
    method: "post",
    data
  })
}

export function doBatchCrateApi(data: any) {
  return request({
    url: "/Bill/batchCreate",
    method: "post",
    data
  })
}
export function doBatchWarehouseApi(data: bill.batchWarehouseRequestData) {
  return request({
    url: "/Bill/batchWarehouse",
    method: "post",
    data
  })
}
export function doBatchSellApi(data: bill.batchSellRequestData) {
  return request({
    url: "/Bill/batchSell",
    method: "post",
    data
  })
}

export function doCreateApi(data: bill.createRequestData) {
  return request({
    url: "/Bill/create",
    method: "post",
    data
  })
}
export function doWarehouseApi(data: bill.WarehouseRequestData) {
  return request({
    url: "/Bill/warehouse",
    method: "post",
    data
  })
}
export function doWarehouseEditApi(data: bill.WarehouseEditRequestData) {
  return request({
    url: "/Bill/warehouseEdit",
    method: "post",
    data
  })
}

export function doSellApi(data: bill.OutRequestData) {
  return request({
    url: "/Bill/sell",
    method: "post",
    data
  })
}
export function doFinishApi(data: bill.finishRequestData) {
  return request({
    url: "/Bill/finish",
    method: "post",
    data
  })
}

export function createBillsWarehouseApi(data: bill.WarehouseRequestData) {
  return request({
    url: "/Bills/BillsWarehouse",
    method: "post",
    data
  })
}

export function doDeleteApi(data: bill.deleteRequestData) {
  return request({
    url: "/Bill/delete",
    method: "delete",
    data
  })
}

export function batchDeleteApi(data: bill.batchDeleteRequestData) {
  return request({
    url: "/Bill/batchDelete",
    method: "delete",
    data
  })
}

export function doSplitApi(data: bill.splitRequestData) {
  return request({
    url: "/Bill/split",
    method: "post",
    data
  })
}
export function doWithdrawApi(data: bill.withdrawRequestData) {
  return request({
    url: "/Bill/withdraw",
    method: "post",
    data
  })
}
export function batchWithdrawApi(data: bill.batchWithdrawRequestData) {
  return request({
    url: "/Bill/batchWithdraw",
    method: "post",
    data
  })
}

export function getBillUploadLogApi(params: bill_upload.GetListsRequestData) {
  return request({
    url: "/BillUpload/getLists",
    method: "get",
    params
  })
}

export function getBillExportApi(params: bill.GetExportRequestData) {
  return request({
    url: "/Bill/doExport",
    method: "get",
    params
  })
}

export function getBillAnalyzeSourceApi(params: bill.analyzeSourceRequestData) {
  return request({
    url: "/Bill/analyzeSource",
    method: "get",
    params
  })
}

export function getCompanyTimeApi(params: bill.companyTimeRequestData) {
  return request({
    url: "/Bill/getCompanyTime",
    method: "get",
    params
  })
}
export function getCompanyTimeNewApi(params: any) {
  return request({
    url: "/Bill/getCompanyTimeNew",
    method: "get",
    params
  })
}

export function inListsApi(params: bill.inListsRequestData) {
  return request({
    url: "/Bill/inLists",
    method: "get",
    params
  })
}

export function inListsNewApi(params: bill.inListsNewRequestData) {
  return request({
    url: "/Bill/inListsNew",
    method: "get",
    params
  })
}

export function batchEditApi(data: bill.batchEditRequestData) {
  return request({
    url: "/Bill/batchEdit",
    method: "post",
    data
  })
}

export function CompanyBillListApi(params: company_bill.getListRequestData) {
  return request({
    url: "/CompanyBill/getList",
    method: "get",
    params
  })
}

export function CompanyBillCountListApi() {
  return request({
    url: "/CompanyBill/getCountLists",
    method: "get"
  })
}

export function CompanyBillInfoApi(params: company_bill.getInfoRequestData) {
  return request({
    url: "/CompanyBill/getInfo",
    method: "get",
    params
  })
}

export function knotApi(data: company_bill.knotRequestData) {
  return request({
    url: "/CompanyBill/knot",
    method: "post",
    data
  })
}

export function knotsApi(data: company_bill.knotsRequestData) {
  return request({
    url: "/CompanyBill/knots",
    method: "post",
    data
  })
}

export function knotBatchApi(data: company_bill.knotBatchRequestData) {
  return request({
    url: "/CompanyBill/knotBatch",
    method: "post",
    data
  })
}

export function companyBillwithdrawsApi(data: company_bill.knotRequestData) {
  return request({
    url: "/CompanyBill/withdraw",
    method: "put",
    data
  })
}

export function billListCurrentApi(params: any) {
  return request({
    url: "/Bill/getListCurrent",
    method: "get",
    params
  })
}
export function billListCurrent2Api(params: any) {
  return request({
    url: "/Bill/getListCurrent2",
    method: "get",
    params
  })
}
